Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

orchestration package with stakeBLD #9078

Merged
merged 5 commits into from
Mar 19, 2024
Merged

orchestration package with stakeBLD #9078

merged 5 commits into from
Mar 19, 2024

Conversation

turadg
Copy link
Member

@turadg turadg commented Mar 13, 2024

closes: #9075
closes: #8857

Description

This implements a StakeBLD story and adds tests for it. The bootstrapTests were made first, to move quickly without Cosmos integration. The a3p test verifies the Cosmos delegation happens.

This also adds the @agoric/orchestration package, which could be separated into another PR.

Security Considerations

Cosmos transactions through JS APIs. This is just an example contract though.

Scaling Considerations

n/a, won't be in production

Documentation Considerations

We will need to document LocalChain usage more and perhaps some of the testing utilities.

Testing Considerations

This required some new testing tools, adapted from agoric-cli. At some point we should make them a supported library.

Upgrade Considerations

The proposals here won't be sent to Mainnet.

@turadg turadg force-pushed the 9075-stakeBLD branch 4 times, most recently from 50e8da4 to b1067c6 Compare March 18, 2024 23:10
@turadg turadg changed the title 9075 stakeBLD orchestration package with stakeBLD Mar 18, 2024
@@ -0,0 +1,23 @@
/* global setTimeout */
Copy link
Member Author

@turadg turadg Mar 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the files in this directory are mostly from packages/agoric-cli. I think we'll want to DRY it but I don't know when. I'm reluctant to have more exports from agoric-cli. I could see them going in ui-kit though. Or @agoric/contracts as support tools. I figure it's okay to duplicate for tests .

I put them in "test-lib" instead of "lib" in service of Agoric/agoric-3-proposals#115

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could see them going in ui-kit though.

I lean that way.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Punting to #9109

@turadg turadg marked this pull request as ready for review March 19, 2024 00:03
*/
(account, storageNode) => {
// must be the fully synchronous maker because the kit is held in durable state
const topicKit = makeRecorderKit(storageNode, PUBLIC_TOPICS.account[1]);
Copy link
Member

@0xpatrickdev 0xpatrickdev Mar 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is anything being published to vstorage yet? A requirement is not specified in the original ticket, but it seems like something we should tackle (perhaps via a follow up ticket). Could be a good addition to this test - we could check delegatorAddress against something published to vstorage.

This likely needs design and additional input, but as a rough sketch we might want to do something like -

// `${API_URL}/cosmos/auth/v1beta1/accounts/${ACCT_ADDR}`
{
    "address": "agoric1ldmtatp24qlllgxmrsjzcpe20fvlkp448zcuce",
    "pub_key": {
      "@type": "/cosmos.crypto.secp256k1.PubKey",
      "key": "AgX1pQy65LmFCazXlahDxmgoDXxaiVFRwOnxj5Wo8ZCo"
    },
    "account_number": "138",
    "sequence": "404"
  }

helper: UnguardedHelperI,
holder: HolderI,
invitationMakers: M.interface('invitationMakers', {
Delegate: HolderI.payload.methodGuards.makeDelegateInvitation,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in the original requirements, but additional actions we'll likely need -

  • Ability to claim (and withdraw) rewards
  • Ability to undelegate / unbond
  • Ability to redelegate to a different validator

Queries are also coming to mind -

  • Current Delegations
  • Claimable Rewards
  • Current Redelegations
  • Current Unbondings

* @param {string} validatorAddress
* @param {Amount<'nat'>} ertpAmount
*/
async makeDelegateInvitation(validatorAddress, ertpAmount) {
Copy link
Member

@0xpatrickdev 0xpatrickdev Mar 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely out of scope for this PR, but thinking about how we are also accommodating contract consumers (that do not have a smart-wallet compat requirement).

This accommodation might manifest via multiple methods in the PF - one for a SW and one for a SC like sendTo and makeSendInvitation in postalSvc:
https://github.com/agoric-labs/ag-power-tools/blob/main/contract/src/postalSvc.js#L60-L61

We may instead want to treat this as just an example contract and tackle this requirement in vat-orchestration .

@turadg turadg added the automerge:rebase Automatically rebase updates, then merge label Mar 19, 2024
@mergify mergify bot merged commit 3d662f8 into master Mar 19, 2024
66 checks passed
@mergify mergify bot deleted the 9075-stakeBLD branch March 19, 2024 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:rebase Automatically rebase updates, then merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

user story: StakeBLD Create agoric/orchestration package
3 participants